home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
prog
/
pbc23a.arj
/
LIBRARY.TXT
< prev
next >
Wrap
Text File
|
1993-10-27
|
3KB
|
78 lines
So you've never used a library before and you want to know what
gives?
A library is a collection of routines, whether written in BASIC,
assembly language, or some other language altogether. It
provides a convenient way to allow different programs to use the
same sets of standard or special-purpose routines (subprograms
or functions, in BASIC parlance).
There are two forms of libraries for QuickBASIC. The form with
the extension ".LIB" is for use with LINK, for creating
stand-alone programs which do not require the QuickBASIC
environment. This sort of library can be made or manipulated
using the LIB utility provided with QuickBASIC. The form of
library with the extension ".QLB" is for use in the QuickBASIC
environment. It is created with LINK and (unfortunately) can't
be manipulated at all.
To use a QLB library, you specify the /L parameter when starting
up QB:
QB /L PBCLONE
You can optionally include the name of your program before the
/L switch.
To use a LIB library, you specify the name of the library when
you LINK your program. Either let LINK prompt you for the
library or type something like this:
BC program/O; (or whatever)
LINK program/EX,,NUL,PBCLONE
If you are in the QuickBASIC environment and direct the compiler
to produce an .EXE file, it will automatically link the library
for you if you started up QB with the /L option.
Suppose you have more than one library that you wish to use?
Well, provided that you have both of the libraries in .LIB form,
this presents no problem. To create a combined .LIB library, use
the LIB utility to extract all of the .OBJ files from one .LIB
and add them to the other one. You can convert the new combined
library to .QLB form by using a special LINK syntax:
LINK combined.LIB/Q/SE:1024,,NUL,BQLB45;
The last two digits of "BQLBxx" represent the version of the
compiler that you have. It doesn't necessarily match the formal
version number, though, so you might just want to use DIR and
see what the name of the file really is. BQLBxx.LIB is one of
the files that comes with QuickBASIC. If you have QBX, use
QBXQLB instead of BQLBxx.
The "/SE:1024" part is only needed when dealing with large
libraries, such as PBClone. It tells LINK to allocate more space
for its internal tables. This doesn't affect the size of the
resulting library, though, so it never hurts to use this
parameter.
If you experience a LINK error, make sure that you're using the
current version of LINK. I've heard from many people who turn
out to have the wrong version of LINK in their PATH somewhere...
when LINK starts up, it will display its version number on the
screen. The version should be around 3.69 as of QuickBASIC 4.5,
or 5.05 for QBX. You must use the LINK that came with
QuickBASIC-- the one that comes with Quick C is incompatible and
the one that came with BASCOM 6.0 (the one with two periods in
the version number) has a few bugs.
If you are using BASCOM 7.0, DO NOT interrupt LINK with a Break
or Control-C, as this may cause it to damage your hard disk!!!
This bug is known to appear in the LINK that comes with BASCOM
7.0. I'm not sure whether they fixed it in BASCOM 7.1. You may
be more familiar with BASCOM 7.x as "PDS" or "The Professional
Development System" (Marketing, ugh).
All clear? No?! Check your BASIC manuals for more information!